
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Multiple Sortable Lists - Inner Join</title>

<style type="text/css">
/*margin and padding on body element
  can introduce errors in determining
  element position and are not recommended;
  we turn them off as a foundation for YUI
  CSS treatments. */
body {
	margin:0;
	padding:0;
}
</style>

<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yui/yui-min.js"></script>

<!--there is no custom header content for this example-->

</head>

<body class="yui3-skin-sam  yui-skin-sam">

<h1>Multiple Sortable Lists - Inner Join</h1>

<div class="exampleIntro">
	<p>This example makes multiple sortable lists that are inner joined together. In the example below you will see 2 lists. Both lists are sortable, but List #2 can move its items into List #1 and they become sortable. However, List #1 <strong>can not</strong> move its items into List #2.</p>
			
</div>

<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->

<style>
    #demo {
        float: none;
        border: 1px solid black;
    }
    #demo li {
        background-image: none;
        list-style-type: none;
        padding: 3px;
        width: 150px;
        border: 1px solid black;
        margin: 3px;
        background-color: #8DD5E7;
    }
    #demo h3 {
        color: #000;
    }
</style>

<div id="demo" class="yui-g">
    <div class="yui-u first">
        <h3>List #1</h3>
        <ul id="list1">
            <li>Item #1.1</li>
            <li>Item #1.2</li>
            <li>Item #1.3</li>
            <li>Item #1.4</li>
            <li>Item #1.5</li>
            <li>Item #1.6</li>
            <li>Item #1.7</li>
            <li>Item #1.8</li>
            <li>Item #1.9</li>
            <li>Item #1.10</li>
        </ul>
	</div>
    <div class="yui-u">
        <h3>List #2</h3>
        <ul id="list2">
            <li>Item #2.1</li>
            <li>Item #2.2</li>
            <li>Item #2.3</li>
            <li>Item #2.4</li>
            <li>Item #2.5</li>
            <li>Item #2.6</li>
            <li>Item #2.7</li>
            <li>Item #2.8</li>
            <li>Item #2.9</li>
            <li>Item #2.10</li>
        </ul>
	</div>
</div>

<script>

YUI().use('dd-constrain', 'sortable', function(Y) {
    var list1 = new Y.Sortable({
        container: '#list1',
        nodes: 'li',
        opacity: '.1',
        moveType: 'move'
    });
    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
        constrain2node: '#demo'
    });

    var list2 = new Y.Sortable({
        container: '#list2',
        nodes: 'li',
        opacity: '.1',
        moveType: 'move'
    });
    list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
        constrain2node: '#demo'
    });


    list1.join(list2, 'inner');
});
</script>

<!--END SOURCE CODE FOR EXAMPLE =============================== -->

</body>
</html>
